'''
def say_hello():
    print('hello world')

say_hello()


def is_even(n):
    if n % 2 == 0:
        return True
    else:
        return False
    
n=int(input('请输入一个数字:'))

if is_even(n):
    print('该数字是偶数')

else:
    print('该数字不是偶数')




def person_info(name,age,greeting='Hello',**extra_info):
    print(f'{greeting},I am {name},I am {age} years old!')
    for key,values in extra_info.items():
        print(f'{key}:{values}')
  
person_info('张三',18,city='Dongguan',county='China')




import math

def calculate_area(shape, **kwargs):
    if shape == 'rectangle':
        length=kwargs.get('_length')
        width=kwargs.get('_width')
        if length is not None and width is not None:  
            return length * width  
        else:  
            return('您的输入有误！')
            

    if shape == 'circle':
        r=kwargs.get('_r')
        if r is not None:  
            return math.pi * r ** 2  
        else:  
            return('您的输入有误！')

while True:
    print('1.矩形 2.圆形')
    n=int(input('请输入您想要得到的图形:'))

    if n == 1:
        length=int(input('请输入长:'))
        width=int(input('请输入宽:'))
        print(calculate_area('rectangle',_length=length,_width=width))
        break

    elif n == 2:
        r=int(input('请输入半径:'))
        print(calculate_area('circle',_r=r))
        break

    elif n== 0:
        break
    else:
        print('输入错误！')





def jiaogu(n):
    count = 0
    while n != 1:
        if n % 2 == 0:
            n=n // 2
            count+=1
        else :
            n = n*3+1
            count+=1
    return count


num =int(input('请输入一个正整数:'))

sum=jiaogu(num)

print(f'一共经过了{sum}次 把{num}变成了1')


def fibonacci_recursive(n):  
    if n <= 0:  
        return 0  
    elif n == 1:  
        return 1  
    else:  
        return fibonacci_recursive(n-1) + fibonacci_recursive(n-2)

n = int(input("请输入月数："))
print(fibonacci_recursive(n))




sort = lambda a,b:a+b
print(sort(1,2))

'''

tuples_list = [(2, 'cat'), (1, 'banana'), (3, 'apple')]

sorted_list = sorted(tuples_list, key=lambda x: x[1])

print(sorted_list)
























